<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/hui/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/hui/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/hui/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/hui/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/hui/static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>资源日志</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 资源日志 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="select-box inline">
			<label class="label label-success radius">科目</label>
			<select name="sub_code" id="sub_code" class="select" style="width: 180px">
				<option value="-1">全部科目</option>
				<foreach name="all_subject" item="vo" key="i">
					<option value="{$vo.sub_code}">{$vo.chname}</option>
				</foreach>
			</select>
			<label class="label label-success radius">章节</label>
			<select name="sectionid" id="sectionid" class="select" style="width: 180px">
				<option value="-1">全部章节</option>
				<foreach name="all_subject_section" item="vo" key="i">
					<option value="{$vo.sectionid}">{$vo.chname}</option>
				</foreach>
			</select>
			<label class="label label-success radius">资源类型</label>
			<select name="rescode" id="rescode" class="select" style="width: 80px">
				<option value="-1">全部类型</option>
				<foreach name="all_dict_resource" item="vo" key="i">
					<option value="{$vo.rescode}">{$vo.resname}</option>
				</foreach>
			</select>
			<label class="label label-success radius">操作人员</label>
			<select name="id" id="id" class="select" style="width: 80px">
				<option value="-1">全部人员</option>
				<foreach name="all_users" item="vo" key="i">
					<option value="{$vo.id}">{$vo.username}</option>
				</foreach>
			</select>
			日期范围：
			<input type="text" onfocus="WdatePicker({})" id="logmin" name="logmin" class="input-text Wdate" style="width:120px;">
			-
			<input type="text" onfocus="WdatePicker({})" id="logmax" name="logmax" class="input-text Wdate" style="width:120px;">
		
			<button name="" id="" onclick="search()" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
	</div>
</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover">
			<thead>
				<tr class="text-c">
					<th width="30">序号</th>
					<th width="100">科目名称</th>
					<th width="100">章节名称</th>
					<th width="100">资源类型</th>
					<th width="">资源名称</th>
					<th width="80">操作员</th>
					<th width="80">操作</th>
					<th width="160">操作时间</th>
					<th width="150">操作描述</th>
				</tr>
			</thead>
			<tbody id="searchval" name='searchval'>
				<foreach name="all_resource_log" item="vo" key="i">
					<tr class="text-c">
						<td>{$i+1}</td>
						<td>{$vo.subname}</td>
						<td>{$vo.sectionname}</td>
						<td>{$vo.rescode}</td>
						<td>{$vo.resname}</td>
						<td>{$vo.operator}</td>
						<td>{$vo.operate_code}</td>
						<td>{$vo.operattime}</td>
						<td>{$vo.describe}</td>
					</tr>
				</foreach>
			</tbody>
		</table>
	</div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__PUBLIC__/hui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/hui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/hui/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/hui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__PUBLIC__/hui/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="__PUBLIC__/hui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/hui/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[]}// 制定列不参与排序
	]
});

/*日志-查询*/
function search(){
		var sub_code  = $("#sub_code option:selected").val();
		var sectionid = $("#sectionid option:selected").val();
		var rescode   = $("#rescode option:selected").val();
		var id        = $("#id option:selected").text();
		var logmin    = $("#logmin").val();
		var logmax    = $("#logmax").val();

		$.ajax({
			type: 'POST',
			url: "{:U('Admin/Resource/search','','')}",
			data: {
				'sub_code' :sub_code,
				'sectionid':sectionid,
				'rescode'  :rescode,
				'id'       :id,
				'logmin'   :logmin,
				'logmax'   :logmax,
			},
			dataType: 'json',
			success: function(data){
				$("#searchval").children().remove();
				for (var i = 0; i < data.length; i++) {
	                $("#searchval").append("<tr class='text-c' role='row'><td>"+(i+1)+"</td><td>"
	                	+ data[i]['subname'] + "</td><td>"
	                	+ data[i]['sectionname'] + "</td><td>"
	                	+ data[i]['rescode'] + "</td><td>"
	                	+ data[i]['resname'] + "</td><td>"
	                	+ data[i]['operator'] + "</td><td>"
	                	+ data[i]['operate_code'] + "</td><td>"
	                	+ data[i]['operattime'] + "</td><td>"
	                	+ data[i]['describe'] + "</td></tr>");
	            }
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
}

$('#sub_code').change(function () {
    $("#sectionid").children().remove();
    var sub_code = $("#sub_code option:selected").val();
    $.ajax({
        type: "post",
        url: "{:U('Admin/Resource/getsection')}",
        data: {
            'sub_code': sub_code
        },
        success: function (data) {
        	$("#sectionid").append("<option value='-1'>全部章节</option>");
            for (var i = 0; i < data.length; i++) {
                $("#sectionid").append("<option value='" + data[i].sectionid + "'>" + data[i].chname + "</option>");
            }
        }
    });
});
</script>
</body>
</html>